#!/bin/bash

# ============================
# 批量关闭指定端口段上的进程
# 用于开发环境下，清理 Spring Boot 残留的进程
# ============================

for port in {48080..48099}; do
  pid=$(lsof -ti tcp:$port)
  if [ -n "$pid" ]; then
    echo "Killing process on port $port (PID $pid)"
    kill -9 $pid
  fi
done
